using System.Collections.Generic;
using UnityEngine;
namespace Share
{
    public class GameMain : SingletonMono<GameMain>
    {
        // Start is called before the first frame update
        void Start()
        {
            XKLog.DoStart(false, false);
            m_DataBaseList.Clear();
        }

        protected override void OnDestroy()
        {
            m_DataBaseList.Clear();
        }
        // Update is called once per frame
        void Update()
        {
            EventMgr.Instance.DoUpdate();
            UIMgr.Instance.DoUpdate();
            for (int i = 0; i < m_DataBaseList.Count; i++)
                m_DataBaseList[i].DoUpdate();
            if (Input.GetKeyDown(KeyCode.F12))
            {
                UIMgr.Instance.DoOpenWindow("LogShow");
            }
            if (Input.GetKeyDown(KeyCode.F11))
            {
                ScreenshotHelper.Instance.DoCapture();
            }
        }
        List<IDataBase> m_DataBaseList = new List<IDataBase>();
        public void AddDataBase(IDataBase data)
        {
            m_DataBaseList.Add(data);
        }


    }
}